# for循环
for i in range(1,11):
    print("ping -c 1 172.16.%s.1" % i)

#while循环
i = 1
while i <= 5:
    print("ping -c 1 172.16.%s.1" % i)
    i = i + 1

#死循环
import time

# while True:
#     print("python自动化运维")
#     time.sleep(2)

#break 终止整个循环
for i in range(1,6):
    if i == 3:
        break
    else:
        print("ping -c 1 172.16.%s.1" % i)

#continue  终止本次循环
for i in range(1,6):
    if i == 3:
        continue
    else:
        print("ping -c 1 172.16.%s.1" % i)
